<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableGoods extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('shop_id')->index();
            $table->string('category')->index();
            $table->string('name');
            $table->string('tag')->nullable();
            $table->jsonb('cover');
            $table->integer('display_price');
            $table->integer('price');
            $table->text('description');
            $table->integer('visitor')->default(0);
            $table->integer('share_number')->default(0);
            $table->integer('sales_volume')->default(0);
            $table->boolean('is_free')->default(0);
            $table->string('status');
            $table->integer('sort')->default(0);
            $table->integer('need_delivery')->default(0);
            $table->string('order_cover');
            $table->string('share_bg');

            $table->text('remark')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
